import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import javax.swing.JLabel;

import java.awt.Color;
import java.awt.Font;
import javax.swing.ImageIcon;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class LoginFrame extends JFrame {

    private JPanel contentPane;
    private JTextField tf_username;
    private JPasswordField tf_userpass;

    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    LoginFrame frame = new LoginFrame();
                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the frame.
     */
    public LoginFrame() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 595, 418);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        setContentPane(contentPane);
        contentPane.setLayout(null);
        this.setLocationRelativeTo(null);

        JLabel label = new JLabel("景区导览系统");
        label.setIcon(new ImageIcon("D:\\GitHOME\\guangong.jpg"));
        label.setFont(new Font("幼圆", Font.PLAIN, 48));
        label.setForeground(Color.RED);
        label.setBounds(74, 27, 495, 95);
        contentPane.add(label);

        JLabel label_1 = new JLabel("\u8D26\u53F7\uFF1A");
        label_1.setBounds(111, 173, 54, 15);
        contentPane.add(label_1);

        tf_username = new JTextField();
        tf_username.setBounds(194, 170, 188, 21);
        contentPane.add(tf_username);
        tf_username.setColumns(10);

        JLabel label_2 = new JLabel("\u5BC6\u7801\uFF1A");
        label_2.setBounds(111, 221, 54, 15);
        contentPane.add(label_2);

        tf_userpass = new JPasswordField();
        tf_userpass.setBounds(194, 218, 188, 21);
        contentPane.add(tf_userpass);

        JButton bt_login = new JButton("\u767B\u5F55");

        bt_login.setBounds(129, 300, 93, 23);
        contentPane.add(bt_login);

        JButton bt_reset = new JButton("\u91CD\u7F6E");
        bt_reset.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                tf_username.setText("");
                tf_userpass.setText("");
            }
        });
        bt_reset.setBounds(332, 300, 93, 23);
        contentPane.add(bt_reset);
    }
}

